import kgRequest from '@/service'
import type { IPageDataArgs, IPageDataReturn } from './type'

// 增
export function postNewPageDataApi(pageName: string, data: any) {
  return kgRequest.post({
    url: `/${pageName}`,
    data
  })
}

// 查
export function postPageDataApi(pageName: string, data: IPageDataArgs) {
  return kgRequest.post<IPageDataReturn>({
    url:pageName,
    data
  })
}

// 删
export function deletePageDataByIdApi(pageName: string, ids: Array<number>) {
  return kgRequest.post({
    url:pageName,
    data:ids
  })
}

// 改
export function patchPageDataApi(pageName: string, data: any) {
  return kgRequest.post({
    url:pageName,
    data
  })
 
}
 
//更改菜单状态
export function updateStatusApi(pageName: string, data: any) {
  return kgRequest.post({
    url:pageName,
    data
  })
}

//更改菜单状态
export function getDetailsByIdApi(pageName: string, id: number) {
  return kgRequest.post({
    url:pageName,
    data:{id}
  })
}

//封禁
export function userBlockByAccidsApi(pageName: string, data:any) {
  return kgRequest.post({
    url:pageName,
    data
  })
}

//解封
export function userUnblockByAccidsApi(pageName: string, data:any) {
  return kgRequest.post({
    url:pageName,
    data
  })
}









